package com.itheima.controller;


import com.itheima.domain.User;
import com.itheima.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

//@RestController
@Controller
@ResponseBody
@RequestMapping("/mybatis")
public class UserController {
    @Autowired
    private UserMapper userMapper;



    @GetMapping("/send")
    public String insterUser() {
        User user = new User();
        user.setName("huangtiancai");
        user.setAge("18");
        userMapper.inster(user);

        return "success";
    }
}
